﻿function CallWebMethod(params) 
{
	$.ajax({
		type: "POST",
		url: params["WebMethodAdress"],
		data: JSON.stringify(params["Data"]),
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: params["SuccessCallbackFunction"],
		error: params["ErrorCallbackFunction"],
		complete: params["CompleteCallbackFunction"]
	});
}

$(document).ready(function () {

	// Allow the creation of Div buttons with an Href protperty
	$(".Button").click(function () {
		var href = $(this).attr("href");

		if (href != null) {
			window.location = href;
		}

		return true;

	});
	// Move colorbox to the Form element so that it will do a postback
	$("#colorbox, #cboxOverlay").appendTo($("form:first"));

});